﻿<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ocxs="http://OCXS.org/Configuration"
  exclude-result-prefixes="ocxs">

  <xsl:template match="/ocxs:Configuration">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head>
        <title>OCXS Configuration File</title>
        <style type="text/css">
          body {
          font-family: Verdana, Geneva, Tahoma, sans-serif;
          font-size: 0.8em;
          background: #efefef;
          padding: 0px;
          margin: 0px;
          }

          ul {
            list-style: none;
            margin: 0px;
            padding: 0px;
          }
          
          li {
            margin-bottom: 5px;
          }

          .page {
          width: 100%;
          background-color: #ffffff;
          }

          div.topbar {
          width: auto;
          clear: both;
          background-color: #003366;
          height: 65px;
          }

          div.bluedivisor {
          width: auto;
          clear: both;
          border-bottom: 1px solid #002041;
          height: 5px;
          }

          div.greydivisor {
          width: auto;
          clear: both;
          border-bottom: 1px solid #bebe9f;
          height: 5px;
          }

          div.navigationbar {
          width: auto;
          clear: both;
          height: 25px;
          }

          div.sitemapbar {
          width: auto;
          clear: both;
          height: 20px;
          padding-left: 5px;
          }

          div.main {
          width: auto;
          clear: both;
          padding: 5px 5px 5px 5px;
          }

          div.box {
            background-color: #f0f0e0;
            padding: 0px 0px 0px 0px;
            position: relative;
            float: left;
            margin: 10px 0px 20px 15px;
            clear: none;
            max-width:250px;
          }

          div.boxdivisor {
          width: auto;
          clear: both;
          background-color: #bebe9f;
          height: 3px;
          }

          div.innerbox {
            padding: 15px 15px 10px 15px;
            
          }

          div.disc {
          background-color: #efefef;
          padding-top: 15px;
          padding-left: 15px;
          padding-right: 25px;
          }

          div.menubar {
          float: left;
          min-width: 200px;
          clear: none;
          padding-top: 3px;
          padding-left: 5px;
          }

          div.sidemenu {
          float: right;
          min-width: 200px;
          clear: none;
          padding-right: 5px;
          }

          .plain {
          font-family: Verdana, Geneva, Tahoma, sans-serif;
          font-size: 11px;
          font-style: normal;
          font-variant: normal;
          font-weight: normal;
          text-align: left;
          text-decoration: none;
          text-transform: none;
          line-height: 13px;
          color: #000000;
          }

          .plainsmall {
          font-family: Verdana, Geneva, Tahoma, sans-serif;
          font-size: 10px;
          font-style: normal;
          font-variant: normal;
          font-weight: normal;
          text-align: left;
          text-decoration: none;
          text-transform: none;
          line-height: 12px;
          color: #666666;
          }

          .bold {
          font-family: Verdana, Geneva, Tahoma, sans-serif;
          font-size: 11px;
          font-style: normal;
          font-variant: normal;
          font-weight: bold;
          text-align: left;
          text-decoration: none;
          text-transform: none;
          line-height: 13px;
          color: #000000;
          }

          .title {
          font-family: Verdana, Geneva, Tahoma, sans-serif;
          font-size: 20px;
          font-style: normal;
          font-variant: normal;
          font-weight: bold;
          text-align: left;
          text-decoration: none;
          text-transform: none;
          line-height: 22px;
          color: #ffffff;
          }

          .authors {
          font-family: Verdana, Geneva, Tahoma, sans-serif;
          font-size: 12px;
          font-style: normal;
          font-variant: normal;
          font-weight: bold;
          text-align: left;
          text-decoration: none;
          text-transform: none;
          line-height: 13px;
          color: #ffffff;
          }

          .boxtitle {
          font-family: Verdana, Geneva, Tahoma, sans-serif;
          font-size: 11px;
          font-style: normal;
          font-variant: normal;
          font-weight: bold;
          text-align: left;
          text-decoration: none;
          text-transform: none;
          line-height: 12px;
          color: #000000;
          }
          

        </style>
      </head>
      <body>

        <div class="page">
          
          <div class="topbar">
            <div style="padding-top:10px;padding-left:5px">
              <span class="authors">OPC Configurable XML Server/Service (OCXS)</span>
            </div>
            <div style="margin-top:5px;padding-left:5px">
              <span class="title">OCXS Administration End</span>
            </div>
          </div>
          
          <div class="bluedivisor"></div>
         
          <div class="sitemapbar">
            <span class="plainsmall">You are in: Configuration / XML</span>
          </div>
          
          <div class="dotteddivisor"></div>
            <div class="main">

              <h2>Variables</h2>
              
              <xsl:for-each select="ocxs:Variables/ocxs:Variable">

              <div class="box">
                
                <div style="background-color:#dedec5; padding:5px 7px 5px 7px">
                  <span class="boxtitle">
                    <xsl:value-of select="ocxs:VariablePath"/>
                    <span style="color:#338900"><xsl:value-of select="ocxs:VariableName"/></span>
                  </span>
                </div>
                
                <div class="boxdivisor"></div>
                
                <div class="innerbox">
                
                  <div style="margin-bottom:10px">
                    <ul>
                      <li>
                        <span class="bold">Type: </span>
                        <span class="plain">
                          <xsl:value-of select="ocxs:VariableT"/>
                        </span>
                      </li>
                      
                      <li>
                        <span class="bold">Measurement Unit: </span>
                        <xsl:choose>
                          <xsl:when test="ocxs:VariableMU = ''">
                        <span class="plain">Unspecified</span>
                          </xsl:when>
                          <xsl:otherwise>
                            <span class="plain">
                              <xsl:value-of select="ocxs:VariableMU"/>
                            </span>
                          </xsl:otherwise>
                        </xsl:choose>
                      </li>

                      <li>
                        <span class="bold">Period Update: </span>
                        <span class="plain">
                          <xsl:value-of select="ocxs:VariableGenerator/ocxs:PeriodUpdate"/> ms
                        </span>
                      </li>
                      
                      <li>
                        <span class="bold">Generating Function: </span>
                        <xsl:choose>
                          <xsl:when test="not(ocxs:VariableGenerator/ocxs:GeneratingFunction)">
                            <span class="plain">N/A</span>
                          </xsl:when>
                          <xsl:otherwise>
                            <span class="plain">
                              <xsl:value-of select="ocxs:VariableGenerator/ocxs:GeneratingFunction"/>
                            </span>
                          </xsl:otherwise>
                        </xsl:choose>
                      </li>

                      <li>
                        <span class="bold">Static Values: </span>
                        <xsl:choose>
                          <xsl:when test="not(ocxs:VariableGenerator/ocxs:StaticValues)">
                            <span class="plain">N/A</span>
                          </xsl:when>
                          <xsl:otherwise>
                            <span class="plain">[ <xsl:for-each select="ocxs:VariableGenerator/ocxs:StaticValues/ocxs:StaticValue">
                              <xsl:value-of select="."/>, </xsl:for-each> ]
                            </span>
                          </xsl:otherwise>
                        </xsl:choose>
                      </li>
                                           
                    </ul>
                  </div>

                  <div class="greydivisor"></div>

                  <div style="margin-top: 5px;">
                    <xsl:choose>
                      <xsl:when test="ocxs:VariableDescription = ''">
                        <span class="plain">Unspecified description.</span>
                      </xsl:when>
                      <xsl:otherwise>
                        <span class="plain">
                          <xsl:value-of select="ocxs:VariableDescription"/>
                        </span>
                      </xsl:otherwise>
                    </xsl:choose>
                  </div>

                  <xsl:if test="ocxs:VariableGenerator/ocxs:StaticValues and ocxs:VariableGenerator/ocxs:GeneratingFunction">
                  <div style="margin: 10px 5px 5px 5px; border: 1px solid #dc574e; background-color: #dcc7c1; padding: 5px;">
                                        
                    <span class="plain">WARNING: Both Generating Function and Static Values specified. Generating Function will take precedence.</span>
                                          
                  </div>
                  </xsl:if>
                </div>
                
              </div>
                
              </xsl:for-each>
              
            </div>
          <div class="greydivisor"></div>
          
          <div class="disc" style="height:85px">
            <span class="plain">
              <span class="bold">OCXS Administration</span> and <span class="bold">OCXS</span> are licensed under the GNU GPL v2.0 license.
            </span>
            <br/>
            <span class="plain">Powered by: Davide G. Monaco, Andrea Tino. June, July 2011.</span>
            <br/>
            <span class="plain">Accordingly to the GPL license, the present administration tool (and the OCXS platform) are covered by no warranty. The software is available, free and open.</span>
          </div>
        </div>

      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>